package com.day12.java2;

public class Student extends Person{
    String major;
    int id = 1002;//学号

    public Student(){
//        super();//省略部分
    }
    public Student(String major){
//        super();//省略部分
        this.major = major;
    }
    public Student(String name,int age,String major){
//        this.name = name;
//        this.age = age;
        super(name, age);
        this.major = major;
    }

    public void eat(){

        System.out.println("学生：多吃有营养的食物");
    }

    public void study(){
        System.out.println("学生：学习知识");
        this.eat();
        super.eat();
        walk();
    }

    public void show(){
        System.out.println("name ="+ name + ",age ="+ age);
        System.out.println("id =" + id);//1002 id = (this.)id;
        System.out.println("id =" + super.id);
    }
}
